
const ToolBar =  `<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"></rect><rect x="4" y="4" width="40" height="40" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"></rect><path d="M16 4V16H4" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M36 24V36H24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M36 36L24 24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M4 6V26" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7 4L27 4" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path></svg>`
    
    
    
   
    const menuList = [
        {
            title: '30%',
            codeLeft: `<img src="`,
            codeRight: `" alt="" width="30%" />`,
        },
        {
            title: '50%',
            codeLeft: `<img src="`,
            codeRight: `" alt="" width="50%" />`,
        },
        {
            title: '70%',
            codeLeft: `<img src="`,
            codeRight: `" alt="" width="70%" />`,
        },
        {
            title: '100%',
            codeLeft: `<img src="`,
            codeRight: `" alt="" width="100%" />`,
        },
    ];
    
 
 
    export default (options) =>{
        return {
            actions: [
                {
                    icon: ToolBar,
                    title: "图片裁剪",
                    handler: Object.assign({ type: 'dropdown', actions: menuList.map((item) => ({
                            title: item === null || item === void 0 ? void 0 : item.title,
                            handler: {
                                type: 'action',
                                click({ wrapText, editor }) {
                                    var _a;
                                    wrapText(item.codeLeft, item.codeRight);
                                    editor.focus();
                                    (_a = options === null || options === void 0 ? void 0 : options.cb) === null || _a === void 0 ? void 0 : _a.call(options, item);
                                },
                            },
                        })) })
                }
            ]
        };
    }